<layout name="layout" />
<link rel="stylesheet" href="/Css/adgroup.css" type="text/css">
<div class="pageheader notab">
	<h1 class="pagetitle">
		<a href="/" class="linkWay">首页/全部推广计划</a>
		&nbsp;<span class="divider">»</span>&nbsp;
		<a href="/campaign/manage?campaign_id={$campaign.campaign_id}" class="linkWay campaign-title-{$campaign.campaign_id}">{$campaign.title}</a>
		&nbsp;<span class="divider">»</span>&nbsp;
		<a href="#" class="currentWay">{$adgroup.title}</a>
	</h1>
</div>
<div id="contentwrapper" class="contentwrapper">
	 <div id="maincontent" class="adgroup-detail">
		 <div class="setting-header nopadding">
			 <div class="row clearall">
				 <div class="thumb inline-block">
					 <div class="" style="width:50px;">
						 <img id="creative_img1" class="th creative_img" width="100%" src="{$product.pic_url}_160x160.jpg" />
					 </div>
				 </div>
				 <div class="title inline-block">
					 <div class="inline-block">
						 <label class="ad_prop_title">宝贝标题 : </label>
						 <span > <a target="_blank" href="https://item.taobao.com/item.htm?id={$product.num_iid}" title="{$product.title}">{$product.title}</a> </span>
						 <!-- h4> {$product.title} </h4> -->
						 <br /><br />
						 <label class="ad_prop_title">所属类目 :</label>
						 <span class="field">{$product.cats}</span>
					 </div>
				 </div>
				 <div class="actions inline-block">
					 <div class="drive-type-container inline-block">
						 <div class="last">
							 <label>开车类型: </label>
							 <input type="hidden" id="set_smart_type" value="<if condition="$adgroup.drive_type eq 0">1<else/>{$adgroup.drive_type_no}</if>"/>
							 <div class="field">
								 <p class="field switch" id="p_drive_type">
									 <label data-mode="manual"  class="cb-disable frist manul">
										 <span class="switch_drive_type"  <if condition="$adgroup.drive_type eq 0">title="改为手动开车模式，十禾云智投不会再自动更改任何设置。"</if>>手动</span>
									 </label>
									 <label data-mode="auto" class="cb-enable auto_mode" id="unbindclick">
										 <span class="switch_drive_type" <if condition="$adgroup.drive_type neq 0">title="改为自动开车模式，十禾云智投会在你现有设置基础上，根据推广效果定期自动管理维护关键词。"</if>>自动</span>
									 </label>
									 <input type="checkbox" class="checkbox" id="is_manual_drive" name="is_manual_drive" value="1" <if condition="$adgroup.drive_type neq 0">checked="checked"</if>/>
								 </p>
							 </div>
						 </div>
					 </div>

					 <div class="max-price-container inline-block">
						 <form method="post" action="/adgroup/updatePrice">
							 <input type="hidden" value="{$adgroup.adgroup_id}" name="adgroup_id" />
							 <input type="hidden" value="{$current_user_id}" name="user_id" />
							 <div class="last">
								 <label>最高出价：</label>
								 <div class="field">
									 <div class="input-prepend">
										 <span class="add-on">￥</span>
										 <input class="input_price" type="text" name="limit" id="J_keyword_limit" value="{$adgroup['limit']/100}" style="width:30px"  />
										 <input class="btn_confirm" type="button" value="保存" name="save_price" />
									 </div>
								 </div>
							 </div>
						 </form>
					 </div>
				 </div>
			 </div>
		 </div>
		 <div class="widget">
			 <div id="tabs">
				 <div class="tabs_header" style="margin:10px auto;">
					 <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" style="float:left;">
						 <li class="ui-state-default ui-corner-top show">
							 <a id="tab-keywords" href="#keywords" rel="/adgroup/keywords?adgroup_id={$adgroup.adgroup_id}&category_id={$product.cid}&product_id={$product.num_iid}&campaign_id={$adgroup.campaign_id}&action_type=keyword_adgroup<if condition='$adgroup.drive_type eq 1'>&type={$adgroup.drive_type_no}</if>">关键词管理</a>
						 </li>
						 <li class="ui-state-default ui-corner-top">
							 <a id="tab-creatives" href="#creatives" rel="/adgroup/setting?adgroup_id={$adgroup.adgroup_id}" >创意管理</a>
						 </li>
						 <li class="ui-state-default ui-corner-top ui-state-active">
							 <a id="tab-review" href="#review" rel="/adgroup/review?adgroup_id={$adgroup.adgroup_id}">报表信息</a>
						 </li>
						 <li class="ui-state-default ui-corner-top ui-state-active">
							 <a id="tab-log" href="#log">操作记录</a>
						 </li>
					 </ul>

				 </div>

				 <div id="tabs-body">

				 </div>
			 </div>
		 </div>
	</div>
</div>

<script id="tooltip" type="text/html">
	<div id="swift" style=" position:absolute; z-index:99998;left:0;top:0;width:100%;height:100;background-color:#FFFFFF;filter:alpha(opacity=50);opacity:.5"></div>
		<div id="dade" style=" position:absolute;z-index:99999;left:40%;top:20%;width:500;height:500;background-color:#FFFFFF;">
			<div style="height:30px;width:300px;text-align:center;font-size:15px;border-bottom:2px solid blue;line-height:30px;color:blue;">信息提示</div>
			<div style="height:50px;width:300px;text-align:center;font-size:10px;line-height:30px;text-indent:15px;"><%=sometitle%></div>
			<div id="abc" style="height:30px;width:300px;cursor:pointer;text-align:center;font-size:15px;line-height:30px;border-top:2px solid #A5A4A2;margin-top:20px;" href="javascript:void;" onclick="closeBox()">
				<a><%=little%></a></div>
		</div>
</script>
<script id="template-logger" type="text/html">
	<div class="main action-logs">
		<div style="float:left;padding-left:14px;background-color: #f0f0f0;width:100%;font-size:16px">
			最近2周操作记录--推广计划
		</div>
		<br class="clearall" />
		<div class="logger-container">
			<select name="" id="logType" class="type-selector">
				<option value="adgroup">宝贝层面</option>
				<option value="creative">创意层面</option>
				<option value="keyword">关键词层面</option>
			</select>
			<div id="J_logs">
				<table class="metrotable normal_table">

				</table>
			</div>
			<div class="pagables">
				<button class="changePage prev-page">上一页</button>
				<button class="changePage next-page">下一页</button>
			</div>
		</div>
	</div>
</script>
<script id="template-logger-logs" type="text/html">
	<% for(var i=0; i < content.length; ++i){ %>
	<tr >
		<td ><%= content[i].updated_time %></td>
		<td><label class="label"><%= content[i].action_type_name%></label></td>
		<td ><%= content[i].display %></td>
		<%
		var extra_note = content[i]['note'];
		if(extra_note != null && extra_note.length >= 4) {
		%>
		<td class="note_extra" >[ 标题 ]： <%=extra_note[1] %><br><%  if(extra_note[3].length > 35) extra_note[3] = extra_note[3].substring(0, 25) + '...' + extra_note[3].substring(extra_note[3].length - 10);%>
			[ 图片 ]： <a href="<%=extra_note[3] %>" target="_blank"><%=extra_note[3]%></a></td>
		<% } %>
	</tr>
	<% } %>
</script>
<include file="{APP_PATH}Template/Keyword/keywords.html" />
<include file="{APP_PATH}Template/Keyword/keyword.html" />
<include file="{APP_PATH}Template/Keyword/keyword_report.html" />
<script id="template_adjustbyfix_panel" type="text/html">
	<div class="row">
		<div class="setPlatform">
			<span>
				计算机：<input type="radio" name="platform" value="1" checked="checked">
			</span>
			<span>
				移动：<input type="radio" name="platform" value="0" >
			</span>
		</div>
		<p>
			在原价基础上<b class="action_str" class="important"><%=label.action%></b>关键词出价
		</p>
		<label>
			批量 <b class="action_str" class="important"><%=label.action%></b>
		</label>
		<div class="input-prepend small-price" >
			<span class="add-on">￥</span>
			<input type="text" class="price smallprice currencyinput" name="incremental" value="0.05" style="width:50px;"/>
		</div>
		<br class="clearall" />
		<label class="max_label">最高不得<%=label.limit%></label>
		<div class="input-prepend small-price" >
			<span class="add-on">￥</span>
			<input type="text" class="price smallprice currencyinput" name="max_price" value="0.00" style="width:50px;" />
		</div>
	</div>
</script>
<script id="template_adjustbyratio_panel" type="text/html">
	<div class="row">
		<div class="setPlatform">
			<span>
				计算机：<input type="radio" name="platform" value="1" checked="checked">
			</span>
			<span>
				移动：<input type="radio" name="platform" value="0" >
			</span>
		</div>
		<p>在原价基础上<b class="action_str" class="important"><%=label.action%></b>关键词出价</p>
		<div style="vertical-align:middle;">
			<label>按比例 <b class="action_str" class="important"><%=label.action%></b> </label>
				    <span class="field">
					    <select name="incrsratio">
							<option value="5">5%</option>
							<option value="10">10%</option>
							<option value="15">15%</option>
							<option value="20">20%</option>
							<option value="25">25%</option>
							<option value="30">30%</option>
							<option value="40">40%</option>
							<option value="50">50%</option>
							<option value="60">60%</option>
							<option value="70">70%</option>
							<option value="80">80%</option>
							<option value="90">90%</option>
							<option value="100">100%</option>
						</select>
				    </span>
			<label class="max_label">最高不得<%=label.limit%> </label>
			<div class="input-prepend small-price" >
				<span class="add-on">￥</span>
				<input type="text" class="price smallprice currencyinput" name="max_price" value="0.00" style="width:50px;" />
			</div>
		</div>
	</div>
</script>
<script id='template_setprice_panel' type="text/html">
	<div class="row">
		<div class="setPlatform">
			<span>
				计算机：<input type="radio" name="platform" value="1" checked="checked">
			</span>
			<span>
				移动：<input type="radio" name="platform" value="0" >
			</span>
		</div>
		<p>把当前选择的所有关键词的价格统一设置为一个价格</p>
		<label>设置价格为</label>
		<span class="field">
		    <select name="adjustaction">
				<option value="0">统一设置价格为</option>
				<option value="1">推广组默认出价</option>
			</select>
	    </span>
		<div class="input-prepend small-price">
			<span class="add-on">￥</span>
			<input type="text" class="price smallprice currencyinput" name="fixedprice" value="0.05" style="width:50px;"/>
		</div>
	</div>
</script>

<script type="text/javascript">
var ADGROUP_ID = {$adgroup.adgroup_id}; // for _appBar in the sub-pages.
var DRIVE_TYPE = {$adgroup.drive_type}; // for _appBar in the sub-pages.
var IS_ADMIN = {$is_admin};
var MAX_PRICE = {$adgroup.limit};
var MOBILE_DISCOUNT = {$adgroup.mobile_discount};
var USER_ID = {$me['user_id']};
var CAMPAIGN_ID = {$adgroup.campaign_id};
var initTab = window.location.hash ? ('#tab-' + window.location.hash.substr(1)) : '#tab-keywords';

	$(document).ready(function(){
		adgroup.detail($('.adgroup-detail'), {
			init_tab: initTab,
			is_admin: IS_ADMIN,
			adgroup_id: ADGROUP_ID,
			campaign_id: CAMPAIGN_ID,
			drive_type: DRIVE_TYPE,
			max_price: MAX_PRICE,
			user_id: USER_ID,
			mobile_discount: MOBILE_DISCOUNT / 100
		}).init();
	});
</script>

<script>
	$(document).ready(function(){
		if($(".manul").hasClass("selected")){
			$(".max-price-container").remove();
		}
	});
</script>

